//
//  BigImageViewViewController.m
//  Yiqidianyin
//
//  Created by apple on 15/8/25.
//  Copyright (c) 2015年 apple. All rights reserved.
//

#import "BigImageViewViewController.h"
#import "VIPhotoView.h"
#define IPHONE_Version [[[UIDevice currentDevice] systemVersion] floatValue]
#define SCREEN_Width [UIScreen mainScreen].bounds.size.width
#define SCREEN_Height [UIScreen mainScreen].bounds.size.height
@interface BigImageViewViewController ()

@property (weak, nonatomic) IBOutlet UIButton *butImage;
@property (nonatomic,strong)UIImageView *imageView;

@end

@implementation BigImageViewViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
//    [self.butImage setBackgroundImage:self.myImageCell forState:0];
    self.imageView = [[UIImageView alloc]initWithFrame:CGRectMake(100, 100, self.view.bounds.size.width/2, self.view.bounds.size.height/3)];
    self.imageView.center = self.view.center;
    
    UIImage *image = self.myImageCell;
    [self.imageView setImage:image];
    self.imageView.contentMode = UIViewContentModeScaleAspectFit;
    self.imageView.userInteractionEnabled = YES;
    UITapGestureRecognizer * tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)];
    tap.numberOfTapsRequired=1;
    [self.imageView addGestureRecognizer:tap];
    [self.view addSubview:self.imageView];
    
    
    
    
}
-(void)tap:(UITapGestureRecognizer*)tap
{
    VIPhotoView * photoView=[[VIPhotoView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_Width, SCREEN_Height) andImage:self.imageView.image];
    UIView * view =[[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_Width, SCREEN_Height)];
    view.backgroundColor=[UIColor blackColor];
    [view addSubview:photoView];
    UIWindow * window= [UIApplication sharedApplication].keyWindow;
    [window addSubview:view];
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)topButtonImage:(id)sender
{
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
